home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 29
/
Volume 29 - JOGO DISK .iso
/
Games
/
funny_baseball.swf
/
scripts
/
frame_82
/
DoAction.as
Wrap
Text File
|
2006-11-13
|
5KB
|
195 lines
function Check_bat()
{
if(this.player._x >= 256 && this.player._x < 261.2)
{
this.Place = 1;
}
else if(this.player._x >= 261.2 && this.player._x < 266.4)
{
this.Place = 2;
}
else if(this.player._x >= 266.4 && this.player._x < 271.6)
{
this.Place = 3;
}
else if(this.player._x >= 271.6 && this.player._x < 276.8)
{
this.Place = 4;
}
else
{
this.Place = 5;
}
}
function Down()
{
this.onMouseDown = function()
{
if(this.Targ._currentframe == 2)
{
if(this.Follow)
{
this.Hit = true;
this.player2.FFF = true;
this.Follow = false;
this.player.play();
if(!this.bat_snd)
{
SoundObj2.start();
}
}
}
};
}
function Hit_Ball()
{
if(this.Hit)
{
if(this.bat_hit)
{
if(this.player.hit.hitTest(this.player2.ballMC))
{
SoundObj1.start();
this.Hit = false;
if(this.Check == 1)
{
this.Ran = random(2) + 9;
}
else if(this.Check == 2)
{
this.Ran = random(2) + 16;
}
else if(this.Check == 3)
{
this.Ran = random(2) + 23;
}
else if(this.Check == 5)
{
if(this.Place == 1 || this.Place == 2)
{
this.Ran = 15;
}
else if(this.Place == 3)
{
this.Ran = 22;
}
else
{
this.Ran = 29;
}
}
else
{
this.CCC = false;
this.Ran = 30 + random(3);
}
if(this.CCC)
{
if(this.Choice == 1)
{
if(this.Place == 1 || this.Place == 2)
{
this.Ran = this.Ran;
}
else if(this.Place == 3)
{
this.Ran += 4;
}
else
{
this.Ran += 2;
}
}
else if(this.Choice == 2)
{
if(this.Place == 1)
{
this.Ran += 4;
}
else if(this.Place == 2 || this.Place == 3)
{
this.Ran += 2;
}
else
{
this.Ran = this.Ran;
}
}
else if(this.Choice == 3)
{
if(this.Place == 1 || this.Place == 2)
{
this.Ran = this.Ran;
}
else if(this.Place == 3 || this.Place == 4)
{
this.Ran += 2;
}
else
{
this.Ran += 4;
}
}
else if(this.Choice == 4)
{
if(this.Place == 1 || this.Place == 2)
{
this.Ran = 15;
}
else if(this.Place == 3)
{
this.Ran = 22;
}
else
{
this.Ran = 29;
}
}
}
this.player2.ballMc.RX = this.player2.ballMC.ball.ball_in._x;
this.player2.ballMc.RY = this.player2.ballMC.ball.ball_in._y;
this.CCC = true;
this.player2.ballMC.gotoAndStop(this.Ran);
}
}
}
}
this.stop();
this.step = 2;
this.Follow = true;
this.Hit = true;
this.HIHIHI = true;
this.CCC = true;
this.Score = 0;
this.onEnterFrame = function()
{
if(this.vol == 1)
{
soundOn();
this.vol = 2;
}
if(this.vol == 0)
{
soundOff();
this.vol = 2;
}
this.txt = this.Score;
this.Targ._x = this._xmouse;
this.Targ._y = this._ymouse;
if(this.Follow)
{
this.player._x = this.Targ._x;
}
if(this.player._x < 255)
{
this.player._x = 256;
}
else if(this.player._x > 283)
{
this.player._x = 282;
}
Check_bat();
Down();
Hit_Ball();
};